home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 5102 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  823 b 

  1. Path: news.uni-jena.de!news
  2. From: mkt@isun04.inf.uni-jena.de (Tilo Koerbs)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: NEWBIE:strings, spacing, white_spacing
  5. Date: 2 Feb 1996 14:53:02 GMT
  6. Organization: Lehrstuhl fuer Rechnerarchitektur- und kommunikation, FSU Jena
  7. Message-ID: <4et8ge$hg9@fsuj01.rz.uni-jena.de>
  8. References: <4esavf$sqb@cloner4.netcom.com>
  9. Reply-To: mkt@isun04.inf.uni-jena.de
  10. NNTP-Posting-Host: isun07.inf.uni-jena.de
  11.  
  12. To read a whole line you cannot use cin.operator>> .
  13. It reads only to the next white space (spaces, tabs, new-lines, etc.).
  14. You must use cin.getline (or cin.get) to read a whole line:
  15.     cin.getline(buf, buf_len);  // read until newline or
  16.                     // until buf_len - 1 characters are read.
  17. The fct prototype is something like: getline(char *, int, .../* I don't know yet */);
  18.  
  19. Bye.
  20. Tilo Koerbs
  21.  
  22.  
  23.  
  24.